<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : da_300_01.jsp
    Description : 참여후기 사용자 리스트
    author Ki Min
    since 2012. 8. 6.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 8. 6.     Ki Min     최초 생성
--%>

<%@ include file="/WEB-INF/jsp/co/us/include/declare.jspf" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>현대자동차 CSR &#124; 참여후기</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<%@ include file="/WEB-INF/jsp/co/us/include/header.jspf" %>
<script type="text/javaScript" language="javascript">
$(document).ready(function() {
    /* form validation check */
    onloadCharCheck();
    
    $("#srchButn").bind("click", moveSearch);    // 검색
    $("#rgstButn").bind("click", moveRgstPage);    // 등록
    $("#delButn").bind("click", delSubmit);    // 삭제
    $("#srchTxt").bind("keydown", eventEnter);    // 엔터키 제어
});

/*
 * 페이징
 */
function movePage(num) {
    $("#currentPageNo").val(num);
    $("#mainForm").attr('action','/da_300_01.do').submit();
}

/*
 * 검색
 */
function moveSearch() {
    if (!validateForm($("#mainForm"))) {
        return false;
    }
    
    if (!isSchrChk($("#srchTxt").val())) {
        alert("검색어에는 특수문자를 입력할 수 없습니다.");
        $("#srchTxt").focus();
        return false;
    }
    
    $("#currentPageNo").val("1");
    $("#mainForm").attr('action','/da_300_01.do').submit();
}

/*
 * 검색 Text EnterKey 처리
 */
function eventEnter() {
    if (event.key == 13) {
        moveSearch();
    }
}

/*
 * 상세페이지 이동
 */
function moveDtlPage(idx) {
    $("#blbIdx").val(idx);
    $("#mainForm").attr('action','/da_300_02.do').submit();
}

/*
 * 등록페이지 이동
 */
function moveRgstPage() {
    $("#mainForm").attr('action','/da_300_03.do').submit();
}

/*
 * 삭제처리
 */
function delSubmit() {
    
}
</script>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/us/include/top.jsp" %>
    <!-- top -->

    <!-- container -->
    <div id="container">
        <div id="contentsWrap">
            <div id="contentsArea">
                <div class="headingArea">
                    <div class="location">
                        <a href="/ma_100_01.do">홈</a>
                        <a href="/da_100_01.do">CSR 자료실</a>
                        <span>참여후기</span>
                    </div>
                    <h2>참여후기</h2>
                </div>
                <div id="contetns">
                    <div class="reviewVisual">
                        <div id="search">
                            <form id="mainForm" name="mainForm" method="post">
                              <input type="hidden" id="currentPageNo" name="currentPageNo" value="${paginationInfo.currentPageNo}" />
                              <input type="hidden" id="blbIdx" name="blbIdx" value="${result.blbIdx }" />
                                <fieldset>
                                    <legend class="invisible">검색</legend>
                                    <div class="selectArea">
                                        <select id="srchScn" name="srchScn">
                                            <option value="" <c:if test="${rqInfo.srchScn == '' }"><c:out value="selected" /></c:if>>전체</option>
                                            <option value="title" <c:if test="${rqInfo.srchScn == 'title' }"><c:out value="selected" /></c:if>>제목</option>
                                            <option value="pprrNm" <c:if test="${rqInfo.srchScn == 'pprrNm' }"><c:out value="selected" /></c:if>>이름</option>
                                        </select>
                                    </div>
                                    <input type="text" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt }" title="검색어 " maxlength="10" nullable="true" minbyte="1" /><input type="image" id="srchButn" name="srchButn" src="/img/usr/btn/btn_search_font.gif" title="검색" alt="검색" />
                                </fieldset>
                            </form>
                        </div>
                        <h3><img src="/img/usr/common/h3_review.gif" alt="나눌수록 커지는 희망, 함께하는 세상이 아름답습니다." /></h3>
                        <p><img src="/img/usr/common/msg_review.gif" alt="자원봉사 활동, 이벤트 후기 등 현대자동차의 지원 또는 봉사활동에서 느꼈던 따뜻한 마음들을  표현해주세요. 하나 하나의 작은 마음이 모여서 커다란 한마음이 되는 감동, 그것이 희망입니다." /></p>
                    </div>
                    <table border="1" class="tableList" summary="참여후기의 번호,제목,이름,등록일이 기재 되어있는 표">
                        <colgroup>
                            <col width="8%" />
                            <col width="65%" />
                            <col width="12%" />
                            <col width="15%" />
                        </colgroup>
                        <thead>
                            <tr>
                                <th>번호</th>
                                <th>제목</th>
                                <th>이름</th>
                                <th>등록일</th>
                            </tr>
                        </thead>
                        <tbody>
                           <c:choose>
                                <c:when test="${resultList != null && !empty resultList }">
                                    <c:forEach var="result" items="${resultList }" varStatus="status">
                                <tr>
                                    <td class="num">${result.blcNo }</td>
                                    <td class="dirLeft reviewPhoto">
                                        <a href="#none" onclick="moveDtlPage('${result.blbIdx}');return false;">
                                            <span class="figure">
                                            <c:choose>
                                                <c:when test="${result.filPath == 'image' && result.thumnImgNm != null && !empty result.thumnImgNm}">
                                                    <img src="/upfile/image/thumb/${result.thumnImgNm }" alt="" />
                                                </c:when>
                                                <c:otherwise>
                                                    <img src="/img/usr/common/no_img_56_40.gif" alt="" />
                                                </c:otherwise>
                                            </c:choose>
                                            </span>
                                            <c:if test="${fn:length(result.titl) > 35 }">
                                            <span class="reviewTit">${fn:substring(result.titl,0,35) }...</span>
                                            </c:if>
                                            <c:if test="${fn:length(result.titl) <= 35 }">
                                            <span class="reviewTit">${result.titl }</span>
                                            </c:if>
                                        </a>
                                    </td>
                                    <td>${result.pprrNm }</td>
                                    <td class="num">${result.rgstDt }</td>
                                </tr>
                                    </c:forEach>
                                </c:when>
                                <c:otherwise>
                                <tr>
                                    <td colspan="4">등록된 내용이 없습니다.</td>
                                </tr>
                                </c:otherwise>
                            </c:choose>                        
                            
                        </tbody>
                    </table>
                    <div class="btnArea down">
                        <span class="reverse"><a href="#" id="rgstButn"><img src="/img/usr/btn/btn_register.gif" alt="등록" /></a></span>
                    </div>
                    <div class="pageNate">
                        <able:pagination paginationInfo="${paginationInfo }" type="image" jsFunction="movePage" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /container -->
    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/us/include/bottom.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>